package ex.com.jm.food.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
 * 县/区实体层
 * @author zhaojw
 *
 */
@Entity
@Table(name="jm_countys")
public class Countys implements Serializable {

	
	private static final long serialVersionUID = 1L;
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="county_id",nullable=false,unique=true,length=11)
	private int countyId;
	@Column(name="county_name",nullable=false,unique=true,length=11)
	private String countyName;
	@ManyToOne
	@JoinColumn(name="city_id")
	private Citys cityId;
	@OneToMany(mappedBy="countyId",fetch=FetchType.EAGER)
	private Set<Streets> streets=new HashSet<Streets>();
	public int getCountyId() {
		return countyId;
	}
	public void setCountyId(int countyId) {
		this.countyId = countyId;
	}
	public String getCountyName() {
		return countyName;
	}
	public void setCountyName(String countyName) {
		this.countyName = countyName;
	}
	public Citys getCityId() {
		return cityId;
	}
	public void setCityId(Citys cityId) {
		this.cityId = cityId;
	}
	public Set<Streets> getStreets() {
		return streets;
	}
	public void setStreets(Set<Streets> streets) {
		this.streets = streets;
	}

}
